package com.wnxy.sddfp.sms.controller;

import com.wnxy.sddfp.common.result.Result;
import com.wnxy.sddfp.sms.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 短信服务
 */
@RestController
@RequestMapping("/sms")
public class SmsController {

    @Autowired
    private SmsService smsService;

    /**
     * 发送短信
     * @param phone 手机
     * @return
     */
    @GetMapping("/code")
    public Result sendPhoneCode(String phone) {
        smsService.sendPhoneCode(phone);
        return Result.ok();
    }
}
